package com.room.search.domain.vo;

import com.room.search.domain.BaseEntity;

import java.time.Instant;

/**
 * Base abstract class for entities which will hold definitions for created, last modified, created by,
 * last modified by attributes.
 */
public abstract class AbstractAuditingBuilderEntity<T extends AbstractAuditingBuilderEntity<?>> extends BaseEntity {

    public T lastModifiedDate(Instant lastModifiedDate) {
        setLastModifiedDate(lastModifiedDate);
        return (T) this;
    }

    public T createdDate(Instant createDate) {
        setCreatedDate(createDate);
        return (T) this;
    }

    public T createdBy(String createBy) {
        setCreatedBy(createBy);
        return (T) this;
    }

    public T lastModifiedBy(String lastModifiedBy) {
        setLastModifiedBy(lastModifiedBy);
        return (T) this;
    }
}
